package entity;

import java.io.Serializable;

/**
 * The type Response message.
 */
public class ResponseMessage implements Serializable {
    /**
     * The constant serialNum.
     *
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public static final long serialNum = 1L;
    /**
     * The Flag.
     */
    private boolean flag;
    /**
     * The Code.
     */
    private int code;
    /**
     * The Message.
     */
    private String message;
    /**
     * The Data.
     */
    private Object data;
    /**
     * The Token.
     */
    private String token;

    /**
     * Instantiates a new Response message.
     *
     * @param flag    the flag
     * @param code    the code
     * @param message the message
     * @param data    the data
     * @param token   the token
     */
    public ResponseMessage(boolean flag, int code, String message, Object data, String token) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
        this.token = token;
    }

    /**
     * To string string.
     *
     * @return the string
     */
    @Override
    public String toString() {
        return "ResponseMessage{" +
                "flag=" + flag +
                ", code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                ", token='" + token + '\'' +
                '}';
    }

    /**
     * Gets token.
     *
     * @return the token
     */
    public String getToken() {
        return token;
    }

    /**
     * Sets token.
     *
     * @param token the token
     */
    public void setToken(String token) {
        this.token = token;
    }

    /**
     * Gets serial num.
     *
     * @return the serial num
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public static long getSerialNum() {
        return serialNum;
    }

    /**
     * Is flag boolean.
     *
     * @return the boolean
     */
    public boolean isFlag() {
        return flag;
    }

    /**
     * Sets flag.
     *
     * @param flag the flag
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    /**
     * Gets code.
     *
     * @return the code
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public int getCode() {
        return code;
    }

    /**
     * Sets code.
     *
     * @param code the code
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public void setCode(int code) {
        this.code = code;
    }

    /**
     * Gets message.
     *
     * @return the message
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public String getMessage() {
        return message;
    }

    /**
     * Sets message.
     *
     * @param message the message
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * Gets data.
     *
     * @return the data
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public Object getData() {
        return data;
    }

    /**
     * Sets data.
     *
     * @param data the data
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public void setData(Object data) {
        this.data = data;
    }

    /**
     * Instantiates a new Response message.
     *
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public ResponseMessage() {
    }

    /**
     * Instantiates a new Response message.
     *
     * @param flag    the flag
     * @param code    the code
     * @param message the message
     * @param data    the data
     * @author overlook
     * @date 2022 -04-16 20:31:47
     */
    public ResponseMessage(boolean flag, int code, String message, Object data) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
    }
}
